//////////////////////////////////////////////////////////////////////////
//	Output Logger
//		Can output messages to the Visual Studio Output Window, or to a file
//		TO USE:
//		To output messages, you must #define _LOGGER_ before including this file
//
//////////////////////////////////////////////////////////////////////////
#ifndef _OUTPUT_LOGGER_H_
#define _OUTPUT_LOGGER_H_

#include <fstream>
#include <string>

namespace Logger
{
	//////////////////////////////////////////////////////////////////////////
	//	OutputToVS
	//	Purpose: Prints out messages to the Visual Studio Output Window
	//	In:		LogTitle - Can be a message type, or the file this message is generated from
	//			Msg - Message for Visual Studios
	//	Out: 
	//	NOTE:  _LOGGER_ must be defined to use it.
	//////////////////////////////////////////////////////////////////////////
	inline void OutputToVS(std::string LogTitle, std::string Msg)
	{
#ifdef _LOGGER_
		if ((LogTitle.size()+Msg.size()) >= 128)
		{
			OutputDebugString("Logger : Failed to print message. Size of Msg & LogTitle > 128 \n");
		}
		else
		{
			char buffer[128];
			sprintf_s(buffer, 128, "%s : %s \n", LogTitle.c_str(), Msg.c_str());
			OutputDebugString(buffer);
		}	
#endif
		
	}

	//////////////////////////////////////////////////////////////////////////
	//	OutputToFile
	//	Purpose: Prints out messages to a file
	//	In:		FileName - Name of the file to print messages to
	//			Msg - Message for the file
	//	Out: 
	//	NOTE:  _LOGGER_ must be defined to use it.
	//////////////////////////////////////////////////////////////////////////
	inline void OutputToFile(std::string FileName, std::string Msg)
	{
#ifdef _LOGGER_
		std::ofstream fout;
#endif
	}

	//////////////////////////////////////////////////////////////////////////
	//	OutputString
	//	Purpose: Prints out messages to the Visual Studio Output Window or a file.
	//	In:		LogTitle - Can be a message type, or the file name.
	//			Msg - Message to print
	//	NOTE:  _LOGGER_ must be defined to use it.
	//		   To print to a file, _LOGGER_RELEASE_ must be defined.
	//////////////////////////////////////////////////////////////////////////
	inline void OuputString(std::string LogTitle, std::string Msg)
	{
#ifdef _LOGGER_

	#ifdef _LOGGER_RELEASE_
		OutputToFile(LogTitle, Msg);
	#else
		OutputToVS(LogTitle, Msg);
	#endif
			
			
#endif
	}
};

#endif